package com.cn.wanxi.servlet;

import com.cn.wanxi.model.NavModel;
import com.cn.wanxi.service.CompanyService;
import com.cn.wanxi.service.ICompanyService;
import com.cn.wanxi.service.INavService;
import com.cn.wanxi.service.NavService;
import com.cn.wanxi.service.impl.CompanyServiceImpl;
import com.cn.wanxi.service.impl.NavServiceImpl;

import javax.servlet.http.HttpServletRequest;

class CommonServlet {
    /**
     * @param req
     */
    static void setCompanyModelAndNewsModels(HttpServletRequest req) {
        ICompanyService iCompanyService=new CompanyServiceImpl();
//        CompanyService companyService = new CompanyService();
        req.setAttribute("companyModel", iCompanyService.getCompapnyModel());
//        NavService navService = new NavService();
        INavService iNavService=new NavServiceImpl();
        NavModel[] navModels = iNavService.getNavModels();
        req.setAttribute("navModels", navModels);
    }
}
